<template>
  <el-config-provider :locale="locale" size="default">
    <router-view />
  </el-config-provider>
</template>
<script lang="ts" setup>
import { useAppStore } from '@/store/modules/app'
const store = useAppStore()
// 导入 Element Plus 中英文语言包
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import en from 'element-plus/es/locale/lang/en'
const locale = computed(() => store.language === 'zh-cn' ? zhCn : en)
// 主题色
watch(() => store.theme, newVal => {
  window.document.documentElement.setAttribute('data-theme', newVal)
}, { immediate:true })
</script>
